package day10.Enum;

import day10.Enum4.Grade;

/**
 * @Auther:小陈的Java
 * 枚举的常用方法
 */
public class EnumMethod {
    public static void main(String[] args) {
        String name = Grade.A.name();
        System.out.println(name);
        Grade a = Grade.valueOf("A");
        System.out.println(a);
        int index = Grade.B.ordinal();
        System.out.println(index);
        Grade[] values = Grade.values();
        for(int i=0;i<values.length;i++){
            System.out.println(values[i]);
        }
    }
}
